DO_MARK=1
CC=gcc
CFLAGS= -g -std=c11 -Ofast -fopenmp -fopenmp-simd -funroll-loops -mavx -I/home/tgm/.local/include 

ifeq ($(DO_MARK),1)
	CFLAGS += -DLIKWID_PERFMON 
endif

LDFLAGS = -lm -fPIC -fopenmp -L/home/tgm/.local/lib
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)

all:$(OBJ)
	$(CC) -o svd $^ $(LDFLAGS)

marked:$(OBJ)
	$(CC) -L/home/tgm/.local/lib -o svd $^ $(LDFLAGS) -llikwid

%.s:%.c
	$(CC) $(CFLAGS) -S -o $@ $<


%.o:%.c
	$(CC) $(CFLAGS) -c -o $@ $<

%.s: %.c
	$(CC) $(CFLAGS) -S -o $@ $<

clean: 
	rm -f *.o
	rm -f *.s
	rm -f svd 
